import type { CourseStatus, CourseType, EntranceTestStatus, RecentStage } from '@/enums/course'

export interface StudyBaseRequestParams {
  studentId: number
  lessonId: number
}

export interface StudyBaseWordsRequestParams extends StudyBaseRequestParams {
  courseId: number
  unitNo: number
}

// 学生单词列表参数
export interface StudentWordListRequestParams extends StudyBaseWordsRequestParams {
}

export interface StudentUnitStageRequestParams extends StudyBaseWordsRequestParams {
}

// 学生单词识记参数
export interface StudentStudyWord {
  wordId: number
  degree: number
}

export interface StudentStudyPreCheckParams extends StudyBaseWordsRequestParams {
  words: StudentStudyWord[]
}

export interface StudentIdParams extends StudyBaseRequestParams {
}

export interface StudentCourseRecommendParams extends StudyBaseRequestParams {
}

export interface StudentWordReviewGroup {
  groupNo: number
  words: StudentWordItem[]
}

// 单词推荐响应
export interface StudentWordReviewRecommendResponse {
  studentId: number
  words: StudentWordItem[]
}

export interface StudentWordReviewContent extends StudentWordListRequestParams {
  studyRecordId: number
  currentGroupNo: number
  groups: StudentWordReviewGroup[]
}

export interface StudentWordShorthandStudyWordItem {
  wordId: number
  clickNum?: number
  correctNum?: number
  wrongNum?: number
  degree?: number
}

export interface StudentWordReviewRecommendWordItem extends StudentWordShorthandStudyWordItem {
}

export interface StudentWordReviewRecommendParams {
  words: StudentWordReviewRecommendWordItem[]
  studentId: number
}

export interface StudyWordParams {
  studentId: number
  studyRecordId: number
  startTime: string
  endTime: string
  duration: number
  words: StudentWordShorthandStudyWordItem[]
}

export interface StudentWordShorthandStudyParams extends StudyBaseWordsRequestParams {
  studyRecordId: number
  startTime: string
  endTime: string
  duration: number
  words: StudentWordShorthandStudyWordItem[]
}

// 学后检查请求参数
export interface StudentWordReviewStudyRequestParams extends Omit<StudentWordShorthandStudyParams, 'studyRecordId'> {
}

// 学后检查响应
export interface StudentWordShorthandPostStudyResponse extends StudyBaseWordsRequestParams {
  score: string
  tip: string
  nextUnitNo: number
}

export interface CourseItem {
  id: number
  name: string
  type?: CourseType
}

export interface StudentWordReviewStudyParams extends StudentWordShorthandStudyParams {
}

export interface StudentUnitParams extends StudentIdParams {
  courseId: number
}

export interface StudentProfile {
  studentId: number
  name: string
  is_entrance_test?: EntranceTestStatus
}

export interface BaseCourseItem {
  id: number
  name: string
}

export interface StudentCourseListCoursesItem {
  course: BaseCourseItem
  wordSummary: {
    totalNum: number
    shorthandNum: number
    examineScore: number
    status: CourseStatus
  }
}
export interface StudentCourseList {
  studentId: number
  courses: StudentCourseListCoursesItem[]
}

export interface StudentCourseItem extends BaseCourseItem {
  type: string
  status: string
  start_time: string
  end_time: string
  course_type: string
  course_type_name: string
}

export interface CategoryItem {
  title: string
  progress: string
  icon?: string
  bgColor?: string
  iconColor?: string
}

export interface Category {
  title: string
  items: CategoryItem[]
}

export interface StudentUnitItem {
  unitNo: number
  name: string
  subhead: string
  totalNum: number
  shorthandNum: number
  examineScore: number
}

export interface StudentUnitList {
  studentId: number
  course: CourseItem
  units: StudentUnitItem[]
}

// 单词列表
export interface StudentWordListResponse extends StudyBaseWordsRequestParams {
  words: StudentWordItem[]
}

export interface StudentWordItem {
  wordId: number
  en: string
  ch: string
  known: boolean | null
  posCh: string
  audio: string
  clickNum?: number
  correctNum?: number
  wrongNum?: number
}

export interface StudentUnitStageResponse {
  wordStudyInfo: {
    totalNum: number
    studiedNum: number
    recentStage: RecentStage
  }
}

export interface StudentCourseRecommendResponse {
  course: CourseItem
  currentUnitNo: number
  wordSummary: {
    totalNum: number
    shorthandNum: number
    completed: boolean
    status: CourseStatus
  }
}
